home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / exec / obtainsemaphorelist.c < prev    next >
C/C++ Source or Header  |  1996-10-24  |  2KB  |  81 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: obtainsemaphorelist.c,v 1.5 1996/10/24 15:50:52 aros Exp $
  4.     $Log: obtainsemaphorelist.c,v $
  5.     Revision 1.5  1996/10/24 15:50:52  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/08/13 13:56:04  digulla
  9.     Replaced AROS_LA by AROS_LHA
  10.     Replaced some AROS_LH*I by AROS_LH*
  11.     Sorted and added includes
  12.  
  13.     Revision 1.3  1996/08/01 17:41:14  digulla
  14.     Added standard header for all files
  15.  
  16.     Desc:
  17.     Lang: english
  18. */
  19. #include "exec_intern.h"
  20. #include "semaphores.h"
  21.  
  22. /*****************************************************************************
  23.  
  24.     NAME */
  25.     #include <exec/semaphores.h>
  26.     #include <clib/exec_protos.h>
  27.  
  28.     AROS_LH1(void, ObtainSemaphoreList,
  29.  
  30. /*  SYNOPSIS */
  31.     AROS_LHA(struct List *, sigSem, A0),
  32.  
  33. /*  LOCATION */
  34.     struct ExecBase *, SysBase, 97, Exec)
  35.  
  36. /*  FUNCTION
  37.     This function obtains all semaphores in the list at once.
  38.     Note that this doesn't include arbitration for the list as
  39.     a whole - you will have to arbitrate for the whole list yourself.
  40.  
  41.     INPUTS
  42.     sigSem - pointer to list full of semaphores
  43.  
  44.     RESULT
  45.  
  46.     NOTES
  47.  
  48.     EXAMPLE
  49.  
  50.     BUGS
  51.  
  52.     SEE ALSO
  53.  
  54.     INTERNALS
  55.  
  56.     HISTORY
  57.  
  58. *****************************************************************************/
  59. {
  60.     AROS_LIBFUNC_INIT
  61.     struct Node *n;
  62.  
  63.     /*
  64.     There's no arbitration needed - the first semaphore in the list
  65.     list arbitrates for the full list.
  66.     Get first element in the list.
  67.     */
  68.     n=sigSem->lh_Head;
  69.  
  70.     /* And follow it. */
  71.     while(n->ln_Succ!=NULL)
  72.     {
  73.     /* Free the semaphore */
  74.     ReleaseSemaphore((struct SignalSemaphore *)n);
  75.  
  76.     /* Get next element */
  77.     n=n->ln_Succ;
  78.     }
  79.     AROS_LIBFUNC_EXIT
  80. } /* ReleaseSemaphoreList */
  81.